[Unit]
Description=Configuration management via supabase-admin-agent salt
After=network.target local-fs.target tmp.mount
Wants=network-online.target
Requires=local-fs.target

[Service]
Type=oneshot
{% if qemu_mode is defined and qemu_mode %}
ExecStart=/opt/supabase-admin-agent/supabase-admin-agent --config /opt/supabase-admin-agent/config.yaml salt --apply --store-result --salt-archive configmanv3-main.tar.gz
User=root
Group=root
{% else %}
ExecStart=/opt/supabase-admin-agent/supabase-admin-agent --config /opt/supabase-admin-agent/config.yaml salt --apply --store-result
User=supabase-admin-agent
Group=supabase-admin-agent
{% endif %}
StandardOutput=journal
StandardError=journal
StateDirectory=supabase-admin-agent
CacheDirectory=supabase-admin-agent
# set tempdir on permanent disk
Environment="TMPDIR=/var/tmp"

[Install]
WantedBy=multi-user.target
